package com.ce.webframework.sec.web;

import com.ce.component.authorization.external.service.IBizSystemAuthorizationService;
import com.ce.pms.base.web.PmsBaseAction;
import com.ce.pms.common.vo.OrganizationalStructureVO;
import com.ce.webframework.sec.service.ISecMenuitemService;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

public class DnDAction extends PmsBaseAction
{
  IBizSystemAuthorizationService comAuthAuthorizationService;
  private ISecMenuitemService secMenuitemService;

  public void setComAuthAuthorizationService(IBizSystemAuthorizationService comAuthAuthorizationService)
  {
    this.comAuthAuthorizationService = comAuthAuthorizationService;
  }

  public IBizSystemAuthorizationService getAuthService() {
    return this.comAuthAuthorizationService;
  }

  public void setSecMenuitemService(ISecMenuitemService secMenuitemService)
  {
    this.secMenuitemService = secMenuitemService;
  }

  public void testList()
    throws Exception
  {
    List navLvl1List = null;
    OrganizationalStructureVO userinfoVO = (OrganizationalStructureVO)getRequest().getSession().getAttribute("loginUser");
    List funs = getAuthService().getAllFunctionEntitiesByType(userinfoVO.getAccountId(), "MENUS", null);
    navLvl1List = this.secMenuitemService.getNavList(funs);
    getRequest().setAttribute("navMainList", navLvl1List);

    getRequest().setAttribute("userJob", userinfoVO.getJob());
  }
}
